package com.yeyks.common.em;

/**
 * @author fuchangshuai
 * @date 2019/06/04 13:24
 */
public enum RoomBedTypeEnum {
    S12("S12", "单床1.2米"),
    DB12("DB12", "双床1.2米"),
    DB15("DB15", "双床1.5米"),
    DB18("DB18", "双床1.8米"),
    S15("S15", "大床1.5米"),
    S18("S18", "大床1.8米"),
    S20("S20", "大床2米"),
    R("R", "圆床");

    String value;
    String desc;

    RoomBedTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(String value) {
        RoomBedTypeEnum[] roomBedTypeEnums = values();
        for (RoomBedTypeEnum roomBedTypeEnum : roomBedTypeEnums) {
            if (roomBedTypeEnum.value().equals(value)) {
                return roomBedTypeEnum.desc();
            }
        }
        return null;
    }

    public static String getValue(String desc) {
        RoomBedTypeEnum[] roomBedTypeEnums = values();
        for (RoomBedTypeEnum roomBedTypeEnum : roomBedTypeEnums) {
            if (roomBedTypeEnum.desc().equals(desc)) {
                return roomBedTypeEnum.value();
            }
        }
        return null;
    }
}
